Correct reads of gpx 'fix' value.
authorrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Mon, 18 Jul 2005 20:16:37 +0000 (20:16 +0000)
committerrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Mon, 18 Jul 2005 20:16:37 +0000 (20:16 +0000)
gpsbabel/gpx.c

index f07198a455067b01cc3650ab4a635917c395b993..36cdb849306fc610956c80f0bb0364e5bd7a7d3e 100644 (file)
@@ -837,7 +837,17 @@ gpx_end(void *data, const char *el)
                wpt_tmp->sat = atof(cdatastrp);
                break;
        case tt_fix:
-               wpt_tmp->fix = atof(cdatastrp);
+               wpt_tmp->fix = atoi(cdatastrp)-1;
+               if ( wpt_tmp->fix < fix_2d) {
+                       if (!strcasecmp(cdatastrp, "none"))
+                               wpt_tmp->fix = fix_none;
+                       else if (!strcasecmp(cdatastrp, "dgps"))
+                               wpt_tmp->fix = fix_dgps;
+                       else if (!strcasecmp(cdatastrp, "pps"))
+                               wpt_tmp->fix = fix_pps;
+                       else
+                               wpt_tmp->fix = fix_unknown;
+               }
                break;
        case tt_unknown:
                end_something_else();